/*
 * Wazuh databaseFeedManager
 * Copyright (C) 2015, Wazuh Inc.
 * September 25, 2023.
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License (version 2) as published by the FSF - Free Software
 * Foundation.
 */
#ifndef _MOCK_POLICYMANAGER_HPP
#define _MOCK_POLICYMANAGER_HPP

#include "gmock/gmock.h"
#include "gtest/gtest.h"

#include "json.hpp"
#include "observer.hpp"

#include <memory>
#include <string>
#include <unordered_set>

/**
 * @class MockPolicyManager
 *
 * @brief Mock class for simulating a policy manager object.
 *
 * The `MockPolicyManager` class is designed to simulate the behavior of a content
 * register for testing purposes. It provides mock implementations of methods and
 * allows you to set expectations on method calls and their return values for testing.
 *
 * This class is used in unit tests only to verify interactions with a content
 * register without actually performing real operations on it.
 */
class MockPolicyManager
{
public:
    MockPolicyManager() = default;

    virtual ~MockPolicyManager() = default;

    /**
     * @brief Mock method for initialize.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(void, initialize, (const nlohmann::json& configuration), ());

    /**
     * @brief Mock method for loadConfiguration.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(void, loadConfiguration, (const nlohmann::json& configuration), ());

    /**
     * @brief Mock method for validateConfiguration.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(void, validateConfiguration, (), ());

    /**
     * @brief Mock method for validateAndConfigureVulnerabilityDetection.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(void, validateAndConfigureVulnerabilityDetection, (const nlohmann::json& vdObj), ());

    /**
     * @brief Mock method for validateAndConfigureIndexer.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(void, validateAndConfigureIndexer, (const nlohmann::json& idObj), ());

    /**
     * @brief Mock method for addSubscriber.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(void, addSubscriber, (std::shared_ptr<Observer<nlohmann::json&>> subscriber), ());

    /**
     * @brief Mock method for removeSubscriber.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(void, removeSubscriber, (const std::string& observerId), ());

    /**
     * @brief Mock method for getUpdaterConfiguration.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(nlohmann::json, getUpdaterConfiguration, (), (const));

    /**
     * @brief Mock method for getExclusions.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(nlohmann::json, getExclusions, (), (const));

    /**
     * @brief Mock method for getIndexerConfiguration.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(nlohmann::json, getIndexerConfiguration, (), (const));

    /**
     * @brief Mock method for getVulnerabilityDetection.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(nlohmann::json, getVulnerabilityDetection, (), (const));

    /**
     * @brief Mock method for isVulnerabilityDetectionEnabled.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(bool, isVulnerabilityDetectionEnabled, (), (const));

    /**
     * @brief Mock method for isIndexerEnabled.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(bool, isIndexerEnabled, (), (const));

    /**
     * @brief Mock method for getFeedUrl.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::string, getFeedUrl, (), (const));

    /**
     * @brief Mock method for getFeedUpdateTime.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(long, getFeedUpdateTime, (), (const));

    /**
     * @brief Mock method for getHostList.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::unordered_set<std::string>, getHostList, (), (const));

    /**
     * @brief Mock method for getCAList.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::unordered_set<std::string>, getCAList, (), (const));

    /**
     * @brief Mock method for getUsername.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::string, getUsername, (), (const));

    /**
     * @brief Mock method for getPassword.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::string, getPassword, (), (const));

    /**
     * @brief Mock method for getCertificate.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::string, getCertificate, (), (const));

    /**
     * @brief Mock method for getKey.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::string, getKey, (), (const));

    /**
     * @brief Mock method for getCTIUrl.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(std::string, getCTIUrl, (), (const));

    /**
     * @brief Mock method for getTranslationLRUSize.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(uint32_t, getTranslationLRUSize, (), (const));

    /**
     * @brief Mock method for getOsdataLRUSize.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(uint32_t, getOsdataLRUSize, (), (const));

    /**
     * @brief Mock method for getRemediationsLRUSize.
     *
     * @note This method is intended for testing purposes and does not perform any real action.
     */
    MOCK_METHOD(uint32_t, getRemediationLRUSize, (), (const));
};

#endif // _MOCK_POLICYMANAGER_HPP
